﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once

#include "GcmpCommonEdit.h"
#include "IInteractionEventArgs.h"

namespace gcmp
{
    class CommandParameters;

    /// \brief 点击鼠标左键类型
    enum class ClickType : int32_t
    {
        SingleClick = 1, ///< 左键单击
        DoubleClick = 2, ///< 左键双击
    };

    /// \brief 命令交互事件的参数集
    class GCMP_COMMON_EDIT_EXPORT ICommandInteractionEventArgs : virtual public IInteractionEventArgs
    {
        DEFINE_CAST_DERIVED(ICommandInteractionEventArgs, IInteractionEventArgs)
    public:
        /// \brief 构造一个ICommandInteractionEventArgs的实例
        ///
        /// \param pElement 关联的Element指针
        /// \param pEvent 命令交互事件指针
        /// \return 命令交互事件的参数集实例
        static OwnerPtr<ICommandInteractionEventArgs> Create(IElement* pElement);

        /// \brief 命令交互事件的类型Id
        ///
        /// \return 命令交互事件类型Id
        static const std::wstring& GetEventTypeId();
    public:
        /// \brief 设置鼠标左键的点击类型
        ///
        /// \param clickType 点击类型
        virtual void SetClickType(ClickType clickType) = 0;

        /// \brief 获取鼠标左键的点击类型
        ///
        /// \return 返回鼠标左键的点击类型
        virtual ClickType GetClickType() const = 0;

        ///  \brief 设置命令参数
        ///
        /// \param  cmdParams  命令参数
        /// \return
        virtual void SetCommandParameters(const CommandParameters& cmdParams) = 0;

        ///  \brief 获取命令参数
        ///
        /// \return 命令参数
        virtual const CommandParameters& GetCommandParameters() const = 0;

        /// \brief 事件是否被处理
        ///
        /// return 返回事件是否被处理
        virtual bool IsExcuted() const  = 0;

        /// \brief 设置事件是否被处理
        ///
        /// \param 是否处理的标志
        virtual void SetExcuted(bool isExcuted) = 0;
    };
}
